import socket
language = {"what is your name?":"zsq","how old are you?":"22","what is your girlfriend's name":"977","hello":"hello"}
host = "127.0.0.1"
port = 6666
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, port))
s.listen(1)
print("listing at port 6666")
conn,addr = s.accept()
print("Connect by :",addr)
while True:
    data = conn.recv(1024)
    data = data.decode("utf-8")
    if not data:
        break
    print("received messages:",data)
    conn.sendall(language.get(data,"Noting").encode())
conn.close()
s.close()
